package com.xiaoyu.tool.service.kefu;

import com.xiaoyu.tool.entity.kefu.KefuNews;
import com.xiaoyu.tool.repository.kefu.KefuNewsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author xiaoyu on 2018/7/2
 */
@Service
public class KefuNewsService {

    @Autowired
    private KefuNewsRepository kefuNewsRepository;

    public KefuNews findByEventKey(String eventKey) {
        return kefuNewsRepository.findByEventKey(eventKey);
    }

    public KefuNews findByEventAndEventKeyIsNull(String event) {
       return kefuNewsRepository.findByEventAndEventKeyIsNull(event);
    }

    public KefuNews findByEventAndEventKeyLike(String event, String qrscene) {
        return kefuNewsRepository.findByEventAndEventKeyLike(event,qrscene);
    }

    public KefuNews findByEventAndEventKey(String event, String eventKey) {
        return kefuNewsRepository.findByEventAndEventKey(event,eventKey);
    }

    public KefuNews findByEventIsNullAndEventKey(String content) {
        return kefuNewsRepository.findByEventIsNullAndEventKey(content);
    }
}
